import {post} from '@/utils/http'

export function getAccountInfo(data = {}){
  // 添加默认的分页参数
  const defaultData = {
    offset: 0,
    limit: 10000,
    ...data
  }
  return post('/user/user-client/cms/accountInfo/listAll', defaultData)
}

//新增
export function createAccountInfo(data) {
  return post('/user/user-client/cms/accountInfo/insert', data)
}

//修改
export function updateAccountInfo(data) {
  return post('/user/user-client/cms/accountInfo/update', data)
}

//删除
export function deleteAccountInfo(id) {
  return post(`/user/user-client/cms/accountInfo/delete?id=${id}`)
}

//批量删除
export function deleteBatchAccountInfo(ids) {
  // ids 应该是一个字符串，包含以逗号分隔的ID列表，例如 "1,2,3"
  return post('/user/user-client/cms/accountInfo/deleteBatch', null, {
    params: { ids }
  })
}

//查询单个
export function getAccountInfoById(id) {
  return post('/user/user-client/cms/accountInfo/get', {id})
}